package com.zhentao.datacontrol.domain.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;

@TableName("dc_rule")
public class DataControlRule {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String ruleCode;
    private String ruleName;
    private Long groupId;

    // 规则基本信息
    private LocalDate effectiveStartDate;
    private LocalDate effectiveEndDate;
    private Integer rulePriority;
    private String ruleDescription;
    private String contactEmail;

    // 规则状态
    private String status; // DRAFT, PUBLISHED, DISABLED
    private String publishStatus; // UNPUBLISHED, PUBLISHED

    // 规则配置
    private String ruleConfig; // JSON格式
    private String applicableYears;

    // 业务字段
    private String businessFields; // JSON格式
    private String parameterTables; // JSON格式
    private String filterConditions; // JSON格式

    private Integer sortOrder;

    @TableLogic
    private Integer isDelete;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    private String createdBy;
    private String updatedBy;

    // 非数据库字段
    @TableField(exist = false)
    private String groupName;

    @TableField(exist = false)
    private String statusText;

    @TableField(exist = false)
    private String publishStatusText;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getRuleCode() { return ruleCode; }
    public void setRuleCode(String ruleCode) { this.ruleCode = ruleCode; }

    public String getRuleName() { return ruleName; }
    public void setRuleName(String ruleName) { this.ruleName = ruleName; }

    public Long getGroupId() { return groupId; }
    public void setGroupId(Long groupId) { this.groupId = groupId; }

    public LocalDate getEffectiveStartDate() { return effectiveStartDate; }
    public void setEffectiveStartDate(LocalDate effectiveStartDate) { this.effectiveStartDate = effectiveStartDate; }

    public LocalDate getEffectiveEndDate() { return effectiveEndDate; }
    public void setEffectiveEndDate(LocalDate effectiveEndDate) { this.effectiveEndDate = effectiveEndDate; }

    public Integer getRulePriority() { return rulePriority; }
    public void setRulePriority(Integer rulePriority) { this.rulePriority = rulePriority; }

    public String getRuleDescription() { return ruleDescription; }
    public void setRuleDescription(String ruleDescription) { this.ruleDescription = ruleDescription; }

    public String getContactEmail() { return contactEmail; }
    public void setContactEmail(String contactEmail) { this.contactEmail = contactEmail; }

    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }

    public String getPublishStatus() { return publishStatus; }
    public void setPublishStatus(String publishStatus) { this.publishStatus = publishStatus; }

    public String getRuleConfig() { return ruleConfig; }
    public void setRuleConfig(String ruleConfig) { this.ruleConfig = ruleConfig; }

    public String getApplicableYears() { return applicableYears; }
    public void setApplicableYears(String applicableYears) { this.applicableYears = applicableYears; }

    public String getBusinessFields() { return businessFields; }
    public void setBusinessFields(String businessFields) { this.businessFields = businessFields; }

    public String getParameterTables() { return parameterTables; }
    public void setParameterTables(String parameterTables) { this.parameterTables = parameterTables; }

    public String getFilterConditions() { return filterConditions; }
    public void setFilterConditions(String filterConditions) { this.filterConditions = filterConditions; }

    public Integer getSortOrder() { return sortOrder; }
    public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; }

    public Integer getIsDelete() { return isDelete; }
    public void setIsDelete(Integer isDelete) { this.isDelete = isDelete; }

    public LocalDateTime getCreatedTime() { return createdTime; }
    public void setCreatedTime(LocalDateTime createdTime) { this.createdTime = createdTime; }

    public LocalDateTime getUpdatedTime() { return updatedTime; }
    public void setUpdatedTime(LocalDateTime updatedTime) { this.updatedTime = updatedTime; }

    public String getCreatedBy() { return createdBy; }
    public void setCreatedBy(String createdBy) { this.createdBy = createdBy; }

    public String getUpdatedBy() { return updatedBy; }
    public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; }

    public String getGroupName() { return groupName; }
    public void setGroupName(String groupName) { this.groupName = groupName; }

    public String getStatusText() { return statusText; }
    public void setStatusText(String statusText) { this.statusText = statusText; }

    public String getPublishStatusText() { return publishStatusText; }
    public void setPublishStatusText(String publishStatusText) { this.publishStatusText = publishStatusText; }
}
